import * as actionTypes from "./constants.jsx"

// 获取加购的商品
export const getGoods=(data)=>{
    return{
        type:actionTypes.CHANGE_GOODS,
        data
    }
}

// 加购商品的数量
export const getGoodsCount=(data,index)=>{
    return{
        type:actionTypes.CHANGE_GOODS_COUNT,
        data,
        index
    }
}
// 选中商品
export const setSelect=(index)=>{
    return{
        type:actionTypes.CHANGE_SELECT,
        index
    }
}
// 全选
export const setAllSelect=()=>{
    return{
        type:actionTypes.ALL_SELECT
    }
}
// 删除选中
export const setDelectGoods=()=>{
    return{
        type:actionTypes.DELECT_SELECT
    }
}
// 加数量
export const setAddCount=(index)=>{
    return{
        type:actionTypes.ADD_COUNT,
        index
    }
}
// 减
export const setSubCount=(index)=>{
    return{
        type:actionTypes.SUB_COUNT,
        index
    }
}
// 删除状态
export const deleteState=()=>{
    return{
        type:actionTypes.DELETE_STATE
    }
}
